<?php
session_start();

if ( $_SESSION['manager'] )
{
    $result = mysql_query(sprintf('SELECT DISTINCT `actual_street` FROM `requisites` WHERE `actual_street` LIKE \'%s%%\' ORDER BY `actual_street`',mysql_escape_string($_GET['term'])));
    while ( $row = mysql_fetch_row($result) )
    {
	$street[] = $row[0];
    }
    print json_encode($street);
}
?>
